package jwt.controller;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/bus")
@RestController
public class BussinessController {

    @RequestMapping("/info")
    public String info(@RequestBody String info){
        JSONObject jsonObject = JSON.parseObject(info);
        String id = jsonObject.getString("id");
        jsonObject.getString("name");
        jsonObject.getString("content");
        System.out.println("将info信息入库"+jsonObject);
        return "保存成功，ID= "+id;
    }

    @GetMapping("/index")
    public String index(){
        System.out.println("这个是bus项目的index界面，不需要token");
        return "version : 0.0.1";
    }
}
